package com.yuyuan.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yuyuan.user.domain.po.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Update("update tb_user set fans = fans+1 where id = #{userId}")
    void addFans(Long userId);

    @Update("update tb_user set fans = fans-1 where id = #{userId}")
    void subFans(Long userId);

    @Update("update tb_user set followee = followee+1 where id = #{userId}")
    void addFollowee(Long userId);

    @Update("update tb_user set followee = followee-1 where id = #{userId}")
    void subFollowee(Long userId);
}
